Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: apply tachyon optimizations(2 & 5) #329

Merged
merged 6 commits into from
May 22, 2024
Merged

Conversation

guorong009
Copy link

Description

Analyze and apply the tachyon optimizations - 2(batch normalize) & 5(save heap allocations)

Related issues

Changes

  • apply the batch_normalize in everywhere possible of halo2_backend crate

NOTE

  1. batch_normalize
    In order to apply the batch_normalize optimization, the algorithm of batch_normalize & batch_inverse should be implemented for elliptic curves. It is already implemented in pse/halo2curves repo.

  2. save heap allocations
    For this optimization, I just apply one - remove unnecessary "clone" op in "permutation_commit".
    The reason is that other optimizations needless in Rust project.
    Also, the Polynomial implementation has big diff between projects.

@guorong009 guorong009 requested a review from ed255 May 16, 2024 17:00
@guorong009 guorong009 self-assigned this May 16, 2024
@guorong009 guorong009 changed the title improve: apply tachyon optimizations(2 & 5) improve: apply tachyon optimizations(2 & 5) May 16, 2024
Copy link
Member

@ed255 ed255 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM!
I think the most significant one may be the memory optimization.
For the batch normalization, I believe the total cost saving is very small when done after an MSM because the MSM is already very costly (the MSM overshadows the improvement)

@guorong009 guorong009 marked this pull request as ready for review May 22, 2024 02:43
@guorong009 guorong009 merged commit 0513fb4 into main May 22, 2024
17 checks passed
@guorong009 guorong009 deleted the gr@tachyon-optimize-0 branch May 22, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants